def sumDigits(n):
    sum = 0
    while n > 10:
        n1,n = n % 10,n//10
        sum += n1
    sum += n
    return sum

num = eval(input("请输入一个数："))
print(sumDigits(num))